﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using Autodesk.Revit.DB;
using PropGridInfo;

namespace HangerSupport
{
	public class HSPropsLst : XPropsLst
	{
		public HSPropsLst()
		{
			this.m_lstLevel = new List<Level>();
		}

		public HSPropsLst(List<Level> lstLevel)
		{
			this.m_lstLevel = lstLevel;
		}

		private void SetPropCount()
		{
			List<string> list = null;
			int nFloorNum = 0;
			HSType eType = this.m_selHSDefineInfo.m_eType;
			switch (eType)
			{
			case HSType.kZJ_DC:
			{
				nFloorNum = this.m_selHSDefineInfo.m_nFloorNum;
				string[] collection = new string[]
				{
					"名称",
					"只修改根部高度",
					"横担层数",
					"参照标高",
					"标高偏移量",
					"根部高度",
					"净宽",
					"横担空隙",
					"竖杆空隙",
					"连接方式",
					"连接固件1",
					"连接固件2",
					"横担信息",
					"竖杆信息"
				};
				list = new List<string>(collection);
				break;
			}
			case HSType.kZJ_PX:
			{
				nFloorNum = this.m_selHSDefineInfo.m_nFloorNum;
				string[] collection2 = new string[]
				{
					"名称",
					"只修改根部高度",
					"横担层数",
					"参照标高",
					"标高偏移量",
					"根部高度",
					"净宽",
					"横担空隙",
					"竖杆空隙",
					"连接方式",
					"连接固件1",
					"连接固件2",
					"横担信息",
					"竖杆信息",
					"偏心净高",
					"偏心净宽"
				};
				list = new List<string>(collection2);
				break;
			}
			case HSType.kZJ_SJ:
			{
				string[] collection3 = new string[]
				{
					"名称",
					"参照标高",
					"标高偏移量",
					"宽",
					"高",
					"横担空隙",
					"连接方式",
					"横担信息",
					"竖杆信息",
					"斜杆信息",
					"斜撑宽",
					"斜撑高"
				};
				list = new List<string>(collection3);
				break;
			}
			case HSType.kZJ_XB:
			{
				string[] collection4 = new string[]
				{
					"名称",
					"参照标高",
					"标高偏移量",
					"宽",
					"连接固件1",
					"横担空隙",
					"横担信息"
				};
				list = new List<string>(collection4);
				break;
			}
			case HSType.kZJ_CB:
			{
				string[] collection5 = new string[]
				{
					"名称",
					"参照标高",
					"标高偏移量",
					"宽",
					"立管管径",
					"管径偏移量",
					"管箍厚度",
					"管箍长度",
					"连接固件1",
					"横担信息"
				};
				list = new List<string>(collection5);
				break;
			}
			case HSType.kZJ_DZ:
			{
				nFloorNum = this.m_selHSDefineInfo.m_nFloorNum;
				string[] collection6 = new string[]
				{
					"名称",
					"只修改根部高度",
					"横担层数",
					"参照标高",
					"标高偏移量",
					"根部高度",
					"净宽",
					"横担空隙",
					"竖杆空隙",
					"连接方式",
					"横担信息",
					"竖杆信息"
				};
				list = new List<string>(collection6);
				list.Add("连接固件1");
				for (int i = 0; i < this.m_selHSDefineInfo.m_nFloorNum; i++)
				{
					list.Add("连接固件" + (i + 2).ToString());
				}
				break;
			}
			default:
				switch (eType)
				{
				case HSType.kDJ_DC:
				{
					nFloorNum = this.m_selHSDefineInfo.m_nFloorNum;
					string[] collection7 = new string[]
					{
						"名称",
						"只修改根部高度",
						"横担层数",
						"参照标高",
						"标高偏移量",
						"根部高度",
						"净宽",
						"横担空隙",
						"竖杆空隙",
						"连接方式",
						"连接固件1",
						"连接固件2",
						"横担信息",
						"竖杆信息"
					};
					list = new List<string>(collection7);
					break;
				}
				case HSType.kDJ_PX:
				{
					nFloorNum = this.m_selHSDefineInfo.m_nFloorNum;
					string[] collection8 = new string[]
					{
						"名称",
						"只修改根部高度",
						"横担层数",
						"参照标高",
						"标高偏移量",
						"根部高度",
						"净宽",
						"横担空隙",
						"竖杆空隙",
						"连接方式",
						"连接固件1",
						"连接固件2",
						"横担信息",
						"竖杆信息",
						"偏心净高",
						"偏心净宽"
					};
					list = new List<string>(collection8);
					break;
				}
				case HSType.kDJ_GJ:
				{
					string[] collection9 = new string[]
					{
						"名称",
						"只修改根部高度",
						"参照标高",
						"标高偏移量",
						"高",
						"净宽",
						"横担空隙",
						"竖杆空隙",
						"连接固件1",
						"连接固件2",
						"横担信息",
						"竖杆信息",
						"竖杆增加",
						"横担增加"
					};
					list = new List<string>(collection9);
					break;
				}
				case HSType.kDJ_DB:
				{
					string[] collection10 = new string[]
					{
						"名称",
						"只修改根部高度",
						"参照标高",
						"标高偏移量",
						"高",
						"竖杆空隙",
						"连接固件1",
						"竖杆信息"
					};
					list = new List<string>(collection10);
					break;
				}
				case HSType.kDJ_DG:
				{
					string[] collection11 = new string[]
					{
						"名称",
						"只修改根部高度",
						"参照标高",
						"标高偏移量",
						"高",
						"管径",
						"管径偏移量",
						"管箍厚度",
						"管箍长度",
						"连接固件1",
						"竖杆信息"
					};
					list = new List<string>(collection11);
					break;
				}
				case HSType.kDJ_SG:
				{
					string[] collection12 = new string[]
					{
						"名称",
						"只修改根部高度",
						"参照标高",
						"标高偏移量",
						"高",
						"净宽",
						"横担空隙",
						"竖杆空隙",
						"连接固件1",
						"连接固件2",
						"连接固件3",
						"横担信息",
						"竖杆信息",
						"偏心净宽",
						"竖杆增加",
						"横担增加"
					};
					list = new List<string>(collection12);
					break;
				}
				case HSType.kDJ_SL:
				{
					string[] collection13 = new string[]
					{
						"名称",
						"只修改根部高度",
						"参照标高",
						"标高偏移量",
						"高",
						"净宽",
						"横担空隙",
						"竖杆空隙",
						"连接方式",
						"连接固件1",
						"连接固件2",
						"连接固件3",
						"横担信息",
						"竖杆信息",
						"偏心净宽"
					};
					list = new List<string>(collection13);
					break;
				}
				case HSType.kDJ_ZJ:
				{
					string[] collection14 = new string[]
					{
						"名称",
						"只修改根部高度",
						"参照标高",
						"标高偏移量",
						"高",
						"净宽",
						"横担空隙",
						"竖杆空隙",
						"连接方式",
						"连接固件1",
						"连接固件2",
						"横担信息",
						"竖杆信息"
					};
					list = new List<string>(collection14);
					break;
				}
				case HSType.kDJ_YC:
				{
					nFloorNum = this.m_selHSDefineInfo.m_nFloorNum;
					string[] collection15 = new string[]
					{
						"名称",
						"只修改根部高度",
						"横担层数",
						"参照标高",
						"标高偏移量",
						"根部高度",
						"净宽",
						"横担空隙",
						"竖杆空隙",
						"连接固件1",
						"连接固件2",
						"横担信息",
						"竖杆信息",
						"竖杆增加",
						"横担增加"
					};
					list = new List<string>(collection15);
					break;
				}
				case HSType.kDJ_DC3:
				{
					nFloorNum = this.m_selHSDefineInfo.m_nFloorNum;
					string[] collection16 = new string[]
					{
						"名称",
						"只修改根部高度",
						"横担层数",
						"参照标高",
						"标高偏移量",
						"根部高度",
						"净宽",
						"横担空隙",
						"竖杆空隙",
						"连接方式",
						"连接固件1",
						"连接固件2",
						"连接固件3",
						"横担信息",
						"竖杆信息",
						"中杆净宽"
					};
					list = new List<string>(collection16);
					break;
				}
				case HSType.kDJ_PX3:
				{
					nFloorNum = this.m_selHSDefineInfo.m_nFloorNum;
					string[] collection17 = new string[]
					{
						"名称",
						"只修改根部高度",
						"横担层数",
						"参照标高",
						"标高偏移量",
						"根部高度",
						"净宽",
						"横担空隙",
						"竖杆空隙",
						"连接方式",
						"连接固件1",
						"连接固件2",
						"连接固件3",
						"横担信息",
						"竖杆信息",
						"偏心净高",
						"偏心净宽",
						"中杆净宽"
					};
					list = new List<string>(collection17);
					break;
				}
				case HSType.kDJ_DZ:
				{
					nFloorNum = this.m_selHSDefineInfo.m_nFloorNum;
					string[] collection18 = new string[]
					{
						"名称",
						"只修改根部高度",
						"横担层数",
						"参照标高",
						"标高偏移量",
						"根部高度",
						"净宽",
						"横担空隙",
						"竖杆空隙",
						"连接方式",
						"横担信息",
						"竖杆信息"
					};
					list = new List<string>(collection18);
					list.Add("连接固件1");
					for (int j = 0; j < this.m_selHSDefineInfo.m_nFloorNum; j++)
					{
						list.Add("连接固件" + (j + 2).ToString());
					}
					break;
				}
				}
				break;
			}
			this.m_selHSDefineInfo.m_nFloorNum = nFloorNum;
			for (int k = 1; k < this.m_selHSDefineInfo.m_nFloorNum; k++)
			{
				list.Add("净高" + k.ToString());
			}
			list.Add("显示方式");
			list.Add("反转");
			foreach (XPropItem xpropItem in this)
			{
				bool flag = !list.Contains(xpropItem.Name);
				if (flag)
				{
					xpropItem.Browsable = false;
				}
			}
		}

		public void SetHSDefine(ref HSDefineInfo selHSDefineInfo)
		{
			this.m_selHSDefineInfo = selHSDefineInfo;
			base.Clear();
			int num = 0;
			this.AddEnumSizeViewType("基本信息", "显示方式", "尺寸信息显示方式", this.m_selHSDefineInfo.m_kViewType, num++, false, true);
			this.AddString("基本信息", "名称", this.m_selHSDefineInfo.m_strTip, this.m_selHSDefineInfo.m_strName, num++, true);
			this.AddEnumBoolType("基本信息", "反转", "在布置支吊架时按正常情况的镜像进行布置", this.m_selHSDefineInfo.m_bMirrored, num++, false, true);
			this.AddEnumBoolType("基本信息", "只修改根部高度", "是否只修改根部高度，否则修改整个支吊架的标高位置", this.m_selHSDefineInfo.m_bChangeOnlyBaseHigh, num++, false, true);
			this.AddLevel("基本信息", "参照标高", "参照标高名称:确定在空间位置", this.m_selHSDefineInfo.m_strElevationName, num++, false);
			this.AddDouble("基本信息", "标高偏移量", "相对参照标高的偏移量(mm)", this.m_selHSDefineInfo.m_dElevationOffset, num++, false);
			this.AddDouble("基本信息", "根部高度", "根部高度(mm)", this.m_selHSDefineInfo.m_dDistFromGround, num++, false);
			LevelNumType nFloorNum = (LevelNumType)this.m_selHSDefineInfo.m_nFloorNum;
			this.AddEnumLevelNumType("基本信息", "横担层数", "横担层数,可以设置横担立面1-15层", (LevelNumType)this.m_selHSDefineInfo.m_nFloorNum, num++, false, true);
			this.AddDouble("基本信息", "净宽", "净宽度(mm)", this.m_selHSDefineInfo.m_dNetWide, num++, false);
			this.AddDouble("基本信息", "宽", "宽度(mm)", this.m_selHSDefineInfo.m_dNetWide, num++, false);
			this.AddDouble("基本信息", "高", "高(mm)", this.m_selHSDefineInfo.m_dNetHigh[0], num++, false);
			for (int i = 1; i < 20; i++)
			{
				string strName = "净高" + i.ToString();
				this.AddDouble("基本信息", strName, "净高(mm)", this.m_selHSDefineInfo.m_dNetHigh[i], num++, false);
			}
			this.AddDouble("基本信息", "斜撑宽", "斜撑宽(mm)", this.m_selHSDefineInfo.m_dOffsetX, num++, false);
			this.AddDouble("基本信息", "斜撑高", "斜撑高(mm)", this.m_selHSDefineInfo.m_dOffsetY, num++, false);
			this.AddDouble("基本信息", "立管管径", "立管管径(mm)", this.m_selHSDefineInfo.m_dLoopDiameter, num++, false);
			this.AddDouble("基本信息", "管径", "管箍内经(mm)", this.m_selHSDefineInfo.m_dLoopDiameter, num++, false);
			this.AddDouble("基本信息", "管径偏移量", "管径偏移量(mm)，管箍与管道之间的空隙值", this.m_selHSDefineInfo.m_dGapHor, num++, false);
			this.AddDouble("基本信息", "管箍厚度", "管箍厚度(mm)", this.m_selHSDefineInfo.m_dLoopThick, num++, false);
			this.AddDouble("基本信息", "管箍长度", "管箍长度(mm)", this.m_selHSDefineInfo.m_dLoopLength, num++, false);
			this.AddDouble("基本信息", "竖杆增加", "竖杆增加(mm)", this.m_selHSDefineInfo.m_dOffsetY, num++, false);
			this.AddDouble("基本信息", "横担增加", "横担增加(mm)", this.m_selHSDefineInfo.m_dOffsetX, num++, false);
			this.AddDouble("基本信息", "偏心净高", "偏心净高(mm)", this.m_selHSDefineInfo.m_dPXHigh, num++, false);
			this.AddDouble("基本信息", "偏心净宽", "偏心净宽(mm)", this.m_selHSDefineInfo.m_dPXWide, num++, false);
			this.AddDouble("基本信息", "中杆净宽", "中杆净宽(mm)", this.m_selHSDefineInfo.m_dOffsetX, num++, false);
			this.AddEnumEndLinkType("基本信息", "连接方式", "连接方式:常规 对焊 背焊", this.m_selHSDefineInfo.m_eLinkType, num++, false, true);
			this.AddEnumLinkDevice("其他信息", "连接固件1", "连接固件信息", this.m_selHSDefineInfo.m_eLinkDevice1, num++, false, true);
			bool flag = this.m_selHSDefineInfo.m_eType == HSType.kZJ_DZ || this.m_selHSDefineInfo.m_eType == HSType.kDJ_DZ;
			if (flag)
			{
				for (int j = 0; j < 20; j++)
				{
					string strName2 = "连接固件" + (j + 2).ToString();
					this.AddEnumLinkDevice("其他信息", strName2, "连接固件信息", this.m_selHSDefineInfo.m_eLinkDeviceDZ[j], num++, false, true);
				}
			}
			else
			{
				this.AddEnumLinkDevice("其他信息", "连接固件2", "连接固件信息", this.m_selHSDefineInfo.m_eLinkDevice2, num++, false, true);
				this.AddEnumLinkDevice("其他信息", "连接固件3", "连接固件信息", this.m_selHSDefineInfo.m_eLinkDevice3, num++, false, true);
			}
			this.AddStruct("其他信息", "横担信息", "横担材料信息", this.m_selHSDefineInfo.m_matHor, num++, false, true);
			this.AddStruct("其他信息", "竖杆信息", "竖杆材料信息", this.m_selHSDefineInfo.m_matVer, num++, false, true);
			this.AddStruct("其他信息", "斜杆信息", "斜杆材料信息", this.m_selHSDefineInfo.m_matLean, num++, false, true);
			this.AddDouble("其他信息", "横担空隙", "横担空隙：管道与支吊架间隙(mm)，只在提取剖面的时候使用", this.m_selHSDefineInfo.m_dGapHor, num++, false);
			this.AddDouble("其他信息", "竖杆空隙", "竖杆空隙：管道与支吊架间隙(mm)，只在提取剖面的时候使用", this.m_selHSDefineInfo.m_dGapVer, num++, false);
			this.SetPropCount();
		}

		public bool GetValue(ref HSDefineInfo selHSDefineInfo)
		{
			long num = (long)this.m_selHSDefineInfo.m_nFloorNum;
			for (int i = 0; i < this.Count<XPropItem>(); i++)
			{
				XPropItem xpropItem = base[i];
				bool flag = !xpropItem.Browsable || xpropItem.ReadOnly;
				if (!flag)
				{
					string name = xpropItem.Name;
					bool flag2 = name == "显示方式";
					if (flag2)
					{
						selHSDefineInfo.m_kViewType = (SizeViewType)xpropItem.Value;
					}
					bool flag3 = name == "净宽";
					if (flag3)
					{
						selHSDefineInfo.m_dNetWide = (double)xpropItem.Value;
					}
					else
					{
						bool flag4 = name == "反转";
						if (flag4)
						{
							selHSDefineInfo.m_bMirrored = ((BoolType)xpropItem.Value == BoolType.kTrue);
						}
						else
						{
							bool flag5 = name == "只修改根部高度";
							if (flag5)
							{
								selHSDefineInfo.m_bChangeOnlyBaseHigh = ((BoolType)xpropItem.Value == BoolType.kTrue);
							}
							else
							{
								bool flag6 = name == "参照标高";
								if (flag6)
								{
									PropComboItemConvert propComboItemConvert = (PropComboItemConvert)xpropItem.Converter;
									selHSDefineInfo.m_strElevationName = propComboItemConvert.GetValue();
								}
								else
								{
									bool flag7 = name == "标高偏移量";
									if (flag7)
									{
										selHSDefineInfo.m_dElevationOffset = (double)xpropItem.Value;
									}
									else
									{
										bool flag8 = name == "根部高度";
										if (flag8)
										{
											selHSDefineInfo.m_dDistFromGround = (double)xpropItem.Value;
										}
										else
										{
											bool flag9 = name == "横担层数";
											if (flag9)
											{
												selHSDefineInfo.m_nFloorNum = (int)xpropItem.Value;
											}
											else
											{
												bool flag10 = name == "宽";
												if (flag10)
												{
													selHSDefineInfo.m_dNetWide = (double)xpropItem.Value;
												}
												else
												{
													bool flag11 = name == "高";
													if (flag11)
													{
														selHSDefineInfo.m_dNetHigh[0] = (double)xpropItem.Value;
													}
													else
													{
														bool flag12 = name == "斜撑宽";
														if (flag12)
														{
															selHSDefineInfo.m_dOffsetX = (double)xpropItem.Value;
														}
														else
														{
															bool flag13 = name == "斜撑高";
															if (flag13)
															{
																selHSDefineInfo.m_dOffsetY = (double)xpropItem.Value;
															}
															else
															{
																bool flag14 = name == "管径";
																if (flag14)
																{
																	selHSDefineInfo.m_dLoopDiameter = (double)xpropItem.Value;
																}
																else
																{
																	bool flag15 = name == "管径偏移量";
																	if (flag15)
																	{
																		selHSDefineInfo.m_dGapHor = (double)xpropItem.Value;
																	}
																	else
																	{
																		bool flag16 = name == "管箍厚度";
																		if (flag16)
																		{
																			selHSDefineInfo.m_dLoopThick = (double)xpropItem.Value;
																		}
																		else
																		{
																			bool flag17 = name == "管箍长度";
																			if (flag17)
																			{
																				selHSDefineInfo.m_dLoopLength = (double)xpropItem.Value;
																			}
																			else
																			{
																				bool flag18 = name == "立管管径";
																				if (flag18)
																				{
																					selHSDefineInfo.m_dLoopDiameter = (double)xpropItem.Value;
																				}
																				else
																				{
																					bool flag19 = name == "竖杆增加";
																					if (flag19)
																					{
																						selHSDefineInfo.m_dOffsetY = (double)xpropItem.Value;
																					}
																					else
																					{
																						bool flag20 = name == "横担增加";
																						if (flag20)
																						{
																							selHSDefineInfo.m_dOffsetX = (double)xpropItem.Value;
																						}
																						else
																						{
																							bool flag21 = name == "偏心净高";
																							if (flag21)
																							{
																								selHSDefineInfo.m_dPXHigh = (double)xpropItem.Value;
																							}
																							else
																							{
																								bool flag22 = name == "偏心净宽";
																								if (flag22)
																								{
																									selHSDefineInfo.m_dPXWide = (double)xpropItem.Value;
																								}
																								else
																								{
																									bool flag23 = name == "中杆净宽";
																									if (flag23)
																									{
																										selHSDefineInfo.m_dOffsetX = (double)xpropItem.Value;
																									}
																									else
																									{
																										bool flag24 = name == "横担信息";
																										if (flag24)
																										{
																											selHSDefineInfo.m_matHor = (HSMatInfo)xpropItem.Value;
																											selHSDefineInfo.m_matHor.SetTypeCode(selHSDefineInfo.m_matHor.m_kSecType);
																										}
																										else
																										{
																											bool flag25 = name == "竖杆信息";
																											if (flag25)
																											{
																												selHSDefineInfo.m_matVer = (HSMatInfo)xpropItem.Value;
																												selHSDefineInfo.m_matVer.SetTypeCode(selHSDefineInfo.m_matVer.m_kSecType);
																											}
																											else
																											{
																												bool flag26 = name == "斜杆信息";
																												if (flag26)
																												{
																													selHSDefineInfo.m_matLean = (HSMatInfo)xpropItem.Value;
																													selHSDefineInfo.m_matLean.SetTypeCode(selHSDefineInfo.m_matLean.m_kSecType);
																												}
																												else
																												{
																													bool flag27 = name == "连接固件1";
																													if (flag27)
																													{
																														selHSDefineInfo.m_eLinkDevice1 = (HSLinkDevice)xpropItem.Value;
																													}
																													else
																													{
																														bool flag28 = name == "连接方式";
																														if (flag28)
																														{
																															selHSDefineInfo.m_eLinkType = (HSLinkType)xpropItem.Value;
																														}
																														else
																														{
																															bool flag29 = name == "横担空隙";
																															if (flag29)
																															{
																																selHSDefineInfo.m_dGapHor = (double)xpropItem.Value;
																															}
																															else
																															{
																																bool flag30 = name == "竖杆空隙";
																																if (flag30)
																																{
																																	selHSDefineInfo.m_dGapVer = (double)xpropItem.Value;
																																}
																																else
																																{
																																	for (int j = 1; j < 20; j++)
																																	{
																																		string b = "净高" + j.ToString();
																																		bool flag31 = name == b;
																																		if (flag31)
																																		{
																																			selHSDefineInfo.m_dNetHigh[j] = (double)xpropItem.Value;
																																			break;
																																		}
																																	}
																																	bool flag32 = this.m_selHSDefineInfo.m_eType == HSType.kZJ_DZ || this.m_selHSDefineInfo.m_eType == HSType.kDJ_DZ;
																																	if (flag32)
																																	{
																																		for (int k = 0; k < 20; k++)
																																		{
																																			string b2 = "连接固件" + (k + 2).ToString();
																																			bool flag33 = name == b2;
																																			if (flag33)
																																			{
																																				selHSDefineInfo.m_eLinkDeviceDZ[k] = (HSLinkDevice)xpropItem.Value;
																																				break;
																																			}
																																		}
																																	}
																																	else
																																	{
																																		bool flag34 = name == "连接固件2";
																																		if (flag34)
																																		{
																																			selHSDefineInfo.m_eLinkDevice2 = (HSLinkDevice)xpropItem.Value;
																																		}
																																		else
																																		{
																																			bool flag35 = name == "连接固件3";
																																			if (flag35)
																																			{
																																				selHSDefineInfo.m_eLinkDevice3 = (HSLinkDevice)xpropItem.Value;
																																			}
																																		}
																																	}
																																}
																															}
																														}
																													}
																												}
																											}
																										}
																									}
																								}
																							}
																						}
																					}
																				}
																			}
																		}
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
			return num != (long)selHSDefineInfo.m_nFloorNum;
		}

		public void AddLevel(string strCategory, string strName, string strDes, string strLevel, int nOrder = 0, bool bIsRead = false)
		{
			List<string> list = new List<string>();
			foreach (Level level in this.m_lstLevel)
			{
				list.Add(level.Name);
			}
			bool flag = strLevel == "" && list.Count > 0;
			if (flag)
			{
				strLevel = list[0];
			}
			XPropItem xpropItem = new XPropItem();
			xpropItem.Name = strName;
			xpropItem.Category = strCategory;
			xpropItem.Description = strDes;
			xpropItem.ProType = typeof(PropComboItemConvert);
			xpropItem.Converter = new PropComboItemConvert(list, strLevel, false);
			xpropItem.Value = list.Count - 1 - ((PropComboItemConvert)xpropItem.Converter).value;
			xpropItem.ReadOnly = bIsRead;
			xpropItem.Order = nOrder;
			base.Add(xpropItem);
		}

		public void AddInt(string strCategory, string strName, string strDes, int val, int nOrder = 0, bool bIsRead = false)
		{
			base.Add(new XPropItem
			{
				Name = strName,
				Value = val,
				Category = strCategory,
				Description = strDes,
				ProType = typeof(int),
				ReadOnly = bIsRead,
				Order = nOrder
			});
		}

		public void AddDouble(string strCategory, string strName, string strDes, double val, int nOrder = 0, bool bIsRead = false)
		{
			base.Add(new XPropItem
			{
				Name = strName,
				Value = Utils.DoublePrecision(val, 1),
				Category = strCategory,
				Description = strDes,
				ProType = typeof(double),
				ReadOnly = bIsRead,
				Order = nOrder
			});
		}

		public void AddString(string strCategory, string strName, string strDes, string val, int nOrder = 0, bool bIsRead = false)
		{
			base.Add(new XPropItem
			{
				Name = strName,
				Value = val,
				Category = strCategory,
				Description = strDes,
				ProType = typeof(string),
				ReadOnly = bIsRead,
				Order = nOrder
			});
		}

		public void AddEnumLinkDevice(string strCategory, string strName, string strDes, object val, int nOrder = 0, bool bIsRead = false, bool bViewTypeName = true)
		{
			XPropItem xpropItem = new XPropItem();
			xpropItem.Category = strCategory;
			xpropItem.Name = strName;
			xpropItem.Description = strDes;
			xpropItem.ReadOnly = bIsRead;
			xpropItem.Value = val;
			xpropItem.ProType = typeof(HSLinkDevice);
			xpropItem.Browsable = true;
			if (bViewTypeName)
			{
				xpropItem.Converter = new PropGridInfo.EnumConverter();
			}
			xpropItem.Order = nOrder;
			base.Add(xpropItem);
		}

		public void AddEnumEndLinkType(string strCategory, string strName, string strDes, object val, int nOrder = 0, bool bIsRead = false, bool bViewTypeName = true)
		{
			XPropItem xpropItem = new XPropItem();
			xpropItem.Category = strCategory;
			xpropItem.Name = strName;
			xpropItem.Description = strDes;
			xpropItem.ReadOnly = bIsRead;
			xpropItem.Value = val;
			xpropItem.ProType = typeof(HSLinkType);
			xpropItem.Browsable = true;
			if (bViewTypeName)
			{
				xpropItem.Converter = new PropGridInfo.EnumConverter();
			}
			xpropItem.Order = nOrder;
			base.Add(xpropItem);
		}

		public void AddEnumSizeViewType(string strCategory, string strName, string strDes, SizeViewType val, int nOrder = 0, bool bIsRead = false, bool bViewTypeName = true)
		{
			XPropItem xpropItem = new XPropItem();
			xpropItem.Category = strCategory;
			xpropItem.Name = strName;
			xpropItem.Description = strDes;
			xpropItem.ReadOnly = bIsRead;
			xpropItem.Value = val;
			xpropItem.ProType = typeof(SizeViewType);
			xpropItem.Browsable = true;
			if (bViewTypeName)
			{
				xpropItem.Converter = new PropGridInfo.EnumConverter();
			}
			xpropItem.Order = nOrder;
			base.Add(xpropItem);
		}

		public void AddEnumLevelNumType(string strCategory, string strName, string strDes, LevelNumType val, int nOrder = 0, bool bIsRead = false, bool bViewTypeName = true)
		{
			XPropItem xpropItem = new XPropItem();
			xpropItem.Category = strCategory;
			xpropItem.Name = strName;
			xpropItem.Description = strDes;
			xpropItem.ReadOnly = bIsRead;
			xpropItem.Value = val;
			xpropItem.ProType = typeof(LevelNumType);
			xpropItem.Browsable = true;
			if (bViewTypeName)
			{
				xpropItem.Converter = new PropGridInfo.EnumConverter();
			}
			xpropItem.Order = nOrder;
			base.Add(xpropItem);
		}

		public void AddEnumBoolType(string strCategory, string strName, string strDes, bool val, int nOrder = 0, bool bIsRead = false, bool bViewTypeName = true)
		{
			XPropItem xpropItem = new XPropItem();
			xpropItem.Category = strCategory;
			xpropItem.Name = strName;
			xpropItem.Description = strDes;
			xpropItem.ReadOnly = bIsRead;
			xpropItem.Value = (val ? BoolType.kTrue : BoolType.kFalse);
			xpropItem.ProType = typeof(BoolType);
			xpropItem.Browsable = true;
			if (bViewTypeName)
			{
				xpropItem.Converter = new PropGridInfo.EnumConverter();
			}
			xpropItem.Order = nOrder;
			base.Add(xpropItem);
		}

		public void AddEnum(string strCategory, string strName, string strDes, object val, int nOrder = 0, bool bIsRead = false, bool bViewTypeName = true)
		{
			XPropItem xpropItem = new XPropItem();
			xpropItem.Category = strCategory;
			xpropItem.Name = strName;
			xpropItem.Description = strDes;
			xpropItem.ReadOnly = bIsRead;
			xpropItem.Value = val;
			xpropItem.ProType = typeof(object);
			xpropItem.Browsable = true;
			if (bViewTypeName)
			{
				xpropItem.Converter = new PropGridInfo.EnumConverter();
			}
			xpropItem.Order = nOrder;
			base.Add(xpropItem);
		}

		public void AddStruct(string strCategory, string strName, string strDes, object val, int nOrder = 0, bool bIsRead = false, bool bViewTypeName = true)
		{
			base.Add(new XPropItem
			{
				Name = strName,
				Value = val,
				Category = strCategory,
				Description = strDes,
				ProType = typeof(object),
				ReadOnly = bIsRead,
				Converter = new ExpandableObjectConverter(),
				Order = nOrder
			});
		}

		public HSDefineInfo m_selHSDefineInfo;

		public List<Level> m_lstLevel;
	}
}
